This invention relates generally to the field of digital imaging, and more particularly to generating digital representations of full color images.
In a single sensor camera, varying intensities of electromagnetic radiation are measured at an image plane composed of a rectangular array of sensor elements. If the radiation is visible light, then a gray-scale image is produced. In order to construct a full color image, a Bayer color filter array (CFA) can be placed between the lens and the sensors at the image plane. A CFA has one color filter element for each sensor. For a more detailed description, see U.S. Pat. No. 3,971,065 to Bayer.
Usually, at least three different colors are used for the filter elements of the CFA, for example, red, green, and blue (RGB). These three colors are sufficient to recover all colors in the visible light part of the electromagnetic spectrum. However, because each sensor can only measure the intensity of a single color, interpolation is required to recover a full color image from the sparsely sampled image plane.
In most color cameras, one of the colors is sampled more frequently. For example, with the Bayer CFA, the image plane is partitioned in blocks of four sensors having the pattern:
G R
B G
There are two green sensors on one diagonal, and a red and blue sensor on the other. The dominant color is green because green has the maximum sensitivity in the human eye. Therefore green is used to represent high frequency detail.
The measured intensity of the green sensors may be used to determine the overall luminance of the image using simple bilinear interpolation. Then, after the luminance has been determined, the full RGB color values at each location in the image can be interpolated from the chrominance values of neighboring sensors. Such a method is disclosed in U.S. Pat. No. 4,642,678. As a disadvantage, simple bilinear interpolation is prone to color edge artifacts.
In order to minimize this problem, adaptive color plan interpolation has been disclosed in U.S. Pat. No. 5,373,322 to Laroche. There, the gradients of luminance values are determined in the horizontal and vertical directions. The gradient values in these two directions are compared and a single preferred direction is selected. The additional color values at a particular location are interpolated from nearby sensors located in the preferred direction.
In U.S. Pat. No. 5,627,734 to Hamilton, a single preferred direction is selected by using a classifier. The classifier is computed by adding LaPlacian second-order values to the gradient values. Then, like Laroche above, the single direction is used to perform the interpolation.
There is a problem with choosing only a single direction, either horizontal or vertical, for interpolation. In real images, there may be edges which are not predominantly vertical or horizontal. In addition, the image may have many fine detailed features without a specific single directional orientation of the gradient. Therefore, it is desired to provide a method for interpolating additional color values at locations of the image that do not have a single directional gradient bias.
In a digital imaging system, a method and apparatus are provided for interpolating a full color image from a camera having an array of single color sensors. Each sensor measures a single color value, for example, red, green, or blue. The measured color values are stored as an array of data elements in a memory of the system. The location of the data elements in the array correspond to the location of the sensors at the image plane of the camera.
Using color differencing, a set of gradient values is determined for each data element at a specific location in the array. The gradient values correspond to color value differences in a plurality of directions from the data element. Color values are differenced for a smaller fixed sized array centered on each data element.
From the set of gradient values, a threshold value is determined. The threshold can be based on a maximum and minimum gradient of the set. Using the threshold value, a subset of gradient values is selected so that the members of the subset have gradient values less than the threshold. The directions associated with the selected set identify a region where color values are similar. Additional color values for each data element can then be interpolated according to the subset of gradient values.